﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace TyNetCoreBlog.Models.Entities
{
    public class User
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required(ErrorMessage = "{0}不能为空！")]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Required(ErrorMessage = "{0}不能为空！")]
        [DataType(DataType.Password)]
        [Display(Name = "密码")]
        public string Password { get; set; }


        [Required(ErrorMessage = "{0}不能为空！")]
        [Display(Name = "权限")]
        public int Role { get; set; } = 2;  //1为管理员，2为订阅者


        [Required(ErrorMessage = "{0}不能为空！")]
        [Display(Name = "昵称")]
        public string Nickname { get; set; }

        public string QQ { get; set; }

        [Display(Name = "邮箱")]
        public string Email { get; set; }

        [Display(Name = "座右铭")]
        public string Motto { get; set; }

        [Display(Name = "个人简介")]
        public string PersonalProfile { get; set; }


        // 小头像
        public string SmallAvatarIcon { get; set; } = "https://s1.ax1x.com/2020/10/11/0cZtZ6.jpg";
        // 大头像
        public string BigAvatarIcon { get; set; } = "https://s1.ax1x.com/2020/10/11/0cZNdK.jpg";
    }
}
